package com.uzai.console.web.device;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.common.enums.DeviceProductKeyEnum;
import com.uzai.common.enums.DeviceTypeEnum;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.common.utils.DateUtil;
import com.uzai.console.common.utils.Tools;
import com.uzai.console.dto.BaseDto;
import com.uzai.console.dto.device.DeviceQuery;
import com.uzai.console.dto.devicegroup.DeviceGroupIdDto;
import com.uzai.console.dto.devicegroup.DeviceGroupInfoDto;
import com.uzai.console.dto.devicegroup.DeviceGroupQuery;
import com.uzai.console.dto.module.deviceproduct.DeviceProductQuery;
import com.uzai.console.dto.user.usertypegroup.UserTypeGroupQuery;
import com.uzai.console.dto.wechatprivate.configplan.ConfigPlanQuery;
import com.uzai.console.dto.wechatprivate.devicewechatinfo.*;
import com.uzai.console.entity.ConfigPlan;
import com.uzai.console.entity.DeviceGroup;
import com.uzai.console.entity.DeviceWechatInfo;
import com.uzai.console.entity.UserTypeGroup;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.mapper.*;
import com.uzai.console.service.device.DeviceService;
import com.uzai.console.service.device.DeviceTypeService;
import com.uzai.console.service.devicegroup.DeviceGroupService;
import com.uzai.console.service.wechatprivate.DeviceWechatInfoService;
import com.uzai.console.vo.base.SelectKeyVo;
import com.uzai.console.vo.device.DeviceInfoVo;
import com.uzai.console.vo.devicegroup.DeviceGroupInfoVo;
import com.uzai.console.vo.deviceproduct.DeviceProductVo;
import com.uzai.console.vo.login.LoginVo;
import com.uzai.console.vo.user.wechatuser.WechatUserDeciceInfoVo;
import com.uzai.console.vo.wechatprivate.devicewechatinfo.DeviceAmountVo;
import com.uzai.console.vo.wechatprivate.devicewechatinfo.DeviceWechatInfoAddVo;
import com.uzai.console.vo.wechatprivate.devicewechatinfo.DeviceWechatInfoPriceVo;
import com.uzai.console.vo.wechatprivate.devicewechatinfo.DeviceWechatInfoVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * 个人微信机器人管理
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "机器人管理",tags = "全局设置|机器人管理")
@ApiSort(5)
@RestController
public class DeviceController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(DeviceController.class);

    @Autowired
    private DeviceTypeService deviceTypeService;
    @Autowired
    private DeviceService deviceService;

    @ApiOperation(value = "查询登录账号对应的设备类型列表", notes = "查询登录账号对应的设备类型列表", response = SelectKeyVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/device/findDeviceTypeListByLogin")
    public Object findDeviceTypeListByLogin(){
        LoginVo loginInfo = getLoginInfo();
        return deviceTypeService.findDeviceTypeListByLogin(loginInfo);
    }

    @ApiOperation(value = "查询机器人下拉列表", notes = "查询机器人下拉列表", response = DeviceInfoVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/device/findDeviceListByLogin")
    public Object findDeviceListByLogin(@RequestBody DeviceQuery deviceQuery) {
        return deviceService.findDeviceList(deviceQuery);
    }

}
